<script>
export default {
  name: 'GuestIndex',
  data() {
    return {
      image: require('@/assets/mobile/home_bg@2x.png'),
      footer: require('@/assets/mobile/button_01.png'),
      active: 1
    }
  },
  computed: {
    backgroundUrl() {
      return { '--bak-url': 'url(' + this.image + ')' }
    }
  },
  methods: {
    activeButton(val) {
      this.active = val
    }
  }
}
</script>

<template>
  <div class="phone-body" :style="backgroundUrl">
    <div class="phone-content">
      <div class="phone-line">
        <div class="phone-li">
          <div class="phone-image">
            <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
          </div>
          <div class="phone-span">服务名称</div>
        </div>
        <div class="phone-li">
          <div class="phone-image">
            <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
          </div>
          <div class="phone-span">服务名称</div>
        </div>
        <div class="phone-li">
          <div class="phone-image">
            <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
          </div>
          <div class="phone-span">服务名称</div>
        </div>
        <div class="phone-li">
          <div class="phone-image">
            <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
          </div>
          <div class="phone-span">服务名称</div>
        </div>
        <div class="phone-li">
          <div class="phone-image">
            <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
          </div>
          <div class="phone-span">服务名称</div>
        </div>
        <div class="phone-li">
          <div class="phone-image">
            <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
          </div>
          <div class="phone-span">服务名称</div>
        </div>
        <div style="clear: both" />
      </div>
      <div class="phone-line" style="margin-top: 10px;padding: 0 10px;box-sizing: border-box">
        <div class="content-body" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);border-radius: 4px">
          <div class="phone-li" style="width: 33.33%">
            <div class="phone-image">
              <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
            </div>
            <div class="phone-span">服务名称服务名称服务名</div>
          </div>
          <div class="phone-li" style="width: 33.33%">
            <div class="phone-image">
              <el-image src="https://portal2dev.apexedu.com.cn/s/static/image/202310/20231027151757374.png" />
            </div>
            <div class="phone-span">服务名称</div>
          </div>
        </div>
      </div>
    </div>
    <div class="phone-footer">
      <div class="footer-body">
        <div class="footer-li" :class="active === 1? 'active':''" @click="activeButton(1)">
          <div class="footer-image">
            <el-image :src="footer" />
          </div>
          <div class="footer-icon iconfont icon-iconfont icon-a-boxlevel-line" />
          <div class="footer-title">首页</div>
        </div>
        <div class="footer-li" :class="active === 2? 'active':''" @click="activeButton(2)">
          <div class="footer-image">
            <el-image :src="footer" />
          </div>
          <div class="footer-icon iconfont icon-iconfont icon-a-home2-line" />
          <div class="footer-title">首页</div>
        </div>
        <div class="footer-li" :class="active === 3? 'active':''" @click="activeButton(3)">
          <div class="footer-image">
            <el-image :src="footer" />
          </div>
          <div class="footer-icon iconfont icon-iconfont icon-a-userlister-line" />
          <div class="footer-title">首页</div>
        </div>
        <div class="footer-li" :class="active === 4? 'active':''" @click="activeButton(4)">
          <div class="footer-image">
            <el-image :src="footer" />
          </div>
          <div class="footer-icon iconfont icon-iconfont icon-a-userlister-line" />
          <div class="footer-title">首页</div>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.phone-body {
  width: 100%;
  height: 100%;
  position: relative;
}
.phone-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 60px;
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bak-url) no-repeat;
  background-size: contain;
  background-color: #eeeeee;
}
.phone-footer {
  position: fixed;
  left: 0;
  right: 0;
  height: 60px;
  bottom: 0;
  z-index: 10000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
  padding: 0 10px;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #606266;
}
.footer-body {
  width: 100%;
  height: 100%;
  display: flex;
}
.phone-line {
  width: 100%;
  min-height: 80px;
  margin-top: 100px;
}
.phone-image {
  width: 100%;
  height: 50px;
  text-align: center;
  .el-image {
    width: 36px;
    height: 36px;
    margin-top: 6px;
  }
}
.phone-li {
  width: 25%;
  min-height: 80px;
  float: left;
  padding: 5px;
  box-sizing: border-box;
}
.phone-span {
  line-height: 16px;
  text-align: center;
  font-size: 0.9rem;
}
.content-body {
  width: 100%;
  height: auto;
  display: inline-block;
  background-color: rgba(255,255,255,0.7);
}
.footer-li {
  width: 25%;
  height: 60px;
  position: relative;
}
.footer-icon {
  width: 100%;
  height: 35px;
  line-height: 35px;
  text-align: center;
  font-size: 1.4rem;
}
.footer-title {
  width: 100%;
  height: 25px;
  line-height: 15px;
  text-align: center;
  font-size: 0.9rem;
}
.footer-image {
  display: none;
}
.active {
  .footer-image {
    display: block;
    position: absolute;
    text-align: center;
    left: -5px;
    right: -5px;
    height: 30px;
    top: -30px;
    .el-image {
      width: 100%;
      height: 100%;
    }
  }
  .footer-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background-color: #0a84ff;
    color: #fff;
    text-align: center;
    line-height: 40px;
    font-size: 1.5rem;
    font-weight: bold;
    top: -20px;
    left: 50%;
    margin-left: -20px;
  }
  .footer-title {
    width: 100%;
    height: 60px;
    line-height: 85px;
    color: #0a84ff;
  }
}
</style>
